<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ErrorController extends Controller
{
    public static function noaccess(){
        $res=['title'=>'无权限'];
        return view('error.noaccess',['res' => $res]);
    }

    public static function jump(){
        $data = \Cookie::get('notice');
        $data = json_decode($data,true);
        $res=['title'=>'提示'];
        if($data){
            $res['msg']=isset($data['msg'])?$data['msg']:'';
            $res['url']=isset($data['url'])?$data['url']:'/';
            $res['jumpTime']=isset($data['jumpTime'])?$data['jumpTime']:0;
            $res['type']=isset($data['type'])?$data['type']:'notice';
        }else{
            $res['msg']='请勿非法访问！';
            $res['url']='/';
            $res['jumpTime']=5;
            $res['type']='notice';
        }
        //dd($res);
        return view('notice.Index',['res' => $res]);
    }
}
